package edu.nf.converter;

import edu.nf.entity.User;
import edu.nf.vo.UserVO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

/**
 * AUTHOR  CJ
 * <p>
 * *@DATE 2025 - 10 - 23
 */
@Mapper
public interface UserConverter {
    UserConverter INSTANCE = Mappers.getMapper(UserConverter.class);

    @Mappings(
            {
                    @Mapping(source = "name",target = "name"),
                    @Mapping(source = "age",target = "age"),
                    @Mapping(source = "cash",target = "cash",numberFormat = "￥#"),
                    @Mapping(source = "birth",target = "birth",dateFormat = "yyyy-MM-dd"),
            }
    )
    UserVO toUserVO(User user);
}
